package org.jradweb.core.orm;

import java.util.List;

public class PageResult<T> {
	private List<T> list;
	private int pageNumber;
	private int pageCount;
	
	public PageResult(List<T> list,int pageNumber,int pageCount){
		this.list=list;
		this.pageCount=pageCount;
		this.pageNumber=pageNumber;
	}
	
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public int getPageNumber() {
		return pageNumber;
	}
	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}
	public int getPageCount() {
		return pageCount;
	}
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	public int getPreviousPage(){
		return pageNumber<=1?1:pageNumber-1;
	}
	public int getNextPage(){
		return pageNumber>=pageCount?pageCount:pageNumber+1;
	}

}
